package com.xiaocg.iterator;

import java.util.ArrayList;
import java.util.List;

public class StudentAggrImpl implements StudentAggr{

    private List<Student> list = new ArrayList<>();

    @Override
    public void add(Student s) {
        list.add(s);
    }

    @Override
    public void delete(Student s) {
        list.remove(s);
    }

    @Override
    public StudentIterator getIterator() {
        return new StudentIteratorImpl(list);
    }
}
